﻿using HuaweiCloud.Dotnet.Samples.Common;

namespace HuaweiCloud.Dotnet.Samples.ESports.Services
{
    public interface ICurdService<T> : IAppService where T : class, IAggregateRoot
    {
        /// <summary>
        /// 增加d
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task AddAsync(T t);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">实体Id</param>
        /// <returns></returns>
        Task DeleteAsync(int id);
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task UpdateAsync(T t);
        /// <summary>
        /// 通过Id获取单个实体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<T> GetAsync(int id);
        /// <summary>
        /// 获取全部
        /// </summary>
        /// <returns></returns>
        Task<IList<T>> ListAsync();
    }
}
